package com.flower.swagger;

import com.sun.corba.se.impl.orb.ParserTable;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;
import java.util.function.Supplier;

/**
 * @ClassName SwaggerProperties
 * @Description TODO
 * @Author 张晓焕
 * @Date 2022/5/27 13:59
 * @Version 1.0
 */
@ConfigurationProperties("swagger")
public class SwaggerProperties {

        /**
         * 是否开启swagger，生产环境一般关闭，所以这里定义一个变量
         */
        private Boolean enable=false;

        /**
         * 项目应用名
         */
        private String applicationName="";

        /**
         * 项目版本信息
         */
        private String applicationVersion="1.0";

        /**
         * 项目描述信息
         */
        private String applicationDescription="";

        /**
         * 接口调试地址
         */
        private String tryHost="";

        /**作者邮箱
        *
         */
        private String email;

        private String url;

        private String  author;

        private List<String> basepackeg;

        public SwaggerProperties(){

        }

    public Boolean getEnable() {
        return enable;
    }

    public SwaggerProperties setEnable(Boolean enable) {
        this.enable = enable;
        return this;
    }

    public String getApplicationName() {
        return applicationName;
    }

    public SwaggerProperties setApplicationName(String applicationName) {
        this.applicationName = applicationName;
        return this;
    }

    public String getApplicationVersion() {
        return applicationVersion;
    }

    public SwaggerProperties setApplicationVersion(String applicationVersion) {
        this.applicationVersion = applicationVersion;
        return this;
    }

    public String getApplicationDescription() {
        return applicationDescription;
    }

    public SwaggerProperties setApplicationDescription(String applicationDescription) {
        this.applicationDescription = applicationDescription;
        return this;
    }

    public String getTryHost() {
        return tryHost;
    }

    public SwaggerProperties setTryHost(String tryHost) {
        this.tryHost = tryHost;
        return this;
    }


    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public List<String> getBasepackeg() {
        return basepackeg;
    }

    public void setBasepackeg(List<String> basepackeg) {
        this.basepackeg = basepackeg;
    }

    public Supplier<String> getBasePackage(int i) {
     return new Supplier<String >() {
         @Override
         public String get() {
             return basepackeg.get(i);
         }
     };

    }
}
